﻿<%@ Page Language="C#" MasterPageFile="~/Areas/Commerce/Views/Shared/Backend.Master"
    Inherits="System.Web.Mvc.ViewPage<Kooboo.Commerce.Promotions.DiscountByProduct.Promotion_DiscountByProduct>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%: "Discount by product".Localize()%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h3 class="title">
        <%: "Settings".Localize()%></h3>
    <ul class="step clearfix">
        <li><a href="#" class="prev-action-link">
            <%: "Basic".Localize() %></a></li>
        <li class="separator">&gt;</li>
        <li class="current">
            <%: "Settings".Localize() %></li>
    </ul>
    <div class="step-content">
        <div class="common-form">
            <% using (Html.BeginForm())
               { 
            %>
            <%: Html.HiddenFor(i=>i.DiscountRuleId) %>
            <fieldset>
                <legend></legend>
                <table>
                    <tbody>
                        <tr>
                            <th>
                                <%:"Discount type:".Localize() %>
                            </th>
                            <td>
                                <select name="ReduceType">
                                    <%
                   foreach (var item in (IEnumerable<SelectListItem>)ViewData["ReduceType"])
                   {
                                    %>
                                    <option value="<%= item.Value %>" <%=item.Selected?"selected":"" %>>
                                        <%=item.Text %></option>
                                    <%
                   }
                                    %>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <%:"Discount fee:".Localize() %>
                            </th>
                            <td>
                                <%: Html.TextBoxFor(i=>i.ReduceValue) %>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <%:"Product ID:".Localize() %>
                            </th>
                            <td>
                                <%: Html.Hidden("ProductId", ViewData["SelectedProduct"], new { @id = "ProductId" })%>
                                <label id="selectedProductName">
                                    <%: ViewData["SelectedProductName"] %></label>
                                <a href="javascript://" id="ChooseBrand" class="button">
                                    <%:"Choose".Localize() %></a>
                                <div class="hide">
                                    <div id="Brand_Container" title="Choose Brand">
                                        <div class="command clearfix">
                                            <%:"Product".Localize() %>
                                        </div>
                                        <div class="table-container" id="brand_table">
                                            <table>
                                                <tbody>
                                                    <tr>
                                                        <th>
                                                            <%:"Name".Localize() %>
                                                        </th>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <div id="brand_paging" class="pager-wrap">
                                        </div>
                                        <div class="buttons">
                                            <input type="button" class="button" id="close_categories_dialog" value="<%:"Save".Localize() %>" />
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </fieldset>
        </div>
        <p class="buttons">
            <input type="submit" value='<%: "« Previous".Localize() %>' class="button prev" />
            <input type="submit" value='<%: "Finish".Localize() %>' class="button finish" /></p>
        <input id="next" name="next" type="hidden" />
        <%} %>
    </div>
</asp:Content>
<asp:Content ID="ScriptContent" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        var search_product_url = '<%: ViewData["SearchProductAction"] %>';
    </script>
    <%using (var loader = ScriptLoader.RegisterInstance(Kooboo.Commerce.Configuration.ScriptFolder))
      {
          loader.Require("addon.promotions.discountbyproduct.js");
      } %>
</asp:Content>
